﻿using WMLogistics.Model;
using WMLogistics_Dao;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WMLogistics.Service
{
    public class CompanyService
    {
        private CompanyDao dao = new CompanyDao();

        public bool AddComapny(wuliu_company_base company)
        {
            return dao.AddCompany(company) == 1;
        }

        public void ModifyComapny(wuliu_company_base company)
        {
             dao.ModifyComapny(company);
        }

        public int GetCompanyIdByAccountId(int accountid)
        {
            return dao.GetCompanyIdByAccountId(accountid);
        }

        public wuliu_company_base GetCompanyByAccountId(int accountid)
        {
            return dao.GetCompanyByAccountId(accountid).FirstOrDefault();
        }

        public wuliu_company_base GetCompanyById(int company_id)
        {
            return dao.GetCompanyById(company_id);
        }
        /// <summary>
        /// 获取销售人员列表
        /// </summary>
        /// <param name="company_id"></param>
        /// <returns></returns>
        public List<wuliu_company_sales> GetSalesByCompanyId(int company_id)
        {
            return dao.GetSalesByCompanyId(company_id);
        }
        public bool AddSale(wuliu_company_sales mod)
        {
            return dao.AddSale(mod);
        }
    }
}
